$(function(){
//    初始化
var categoryid;
    init();
    function init(){
        categoryid = getQueryString('categoryid');
        console.log(categoryid);
        getProductList();
    }

    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        // if (r != null) return unescape(r[2]);
        if (r != null) return decodeURI(r[2]);
        return null;
    };

    function getProductList(){
        $.get("http://193.112.55.79:9090/api/getproductlist"+window.location.search,function(data){
         console.log(data);
         var htmlStr =template("spTemp",{arr:data.result});
         $(".shangpin").html(htmlStr);
        });
    };
})